#ifndef __ENCODER_H__
#define __ENCODER_H__

typedef struct __attribute__((__packed__))
{
	unsigned short	FrameNum;
	unsigned short	SliceNum;
	unsigned short	PacketNum;
	unsigned char	Channel;
	unsigned char	FrameType;
	unsigned int	TimeStamp;
	unsigned short	DataLen; 
//	unsigned char	Data[1502];
}packet_header_t;

typedef struct frame_header
{
	unsigned char	*video_payload;
	unsigned int	video_type;
	unsigned int	video_len;
	unsigned int	video_timestamp;
	unsigned char	*audio_payload;
	unsigned int	audio_len;
	unsigned int	audio_timestamp;
}frame_header_t;
//}frame_header_t __attribute__ ((__packed__));

#define BANDWIDTH_DOWN			0x00000001UL
#define BANDWIDTH_UP			0X00000000UL

#define MIN_BIT_RATE			64000			//	400K = 4/5 *MIN_BIT_RATE
#define MAX_BIT_RATE			8000000			//	1M = 6/5 * 2500000

//#define MAX_FRAME_SIZE		204800
#define FRAGMENT_SIZE			1024
#define PPS_SPS_INTERVAL		5
#define PPS_BUF_SIZE			1024
#define SPS_BUF_SIZE			1024

#if 0
#define H264_FRAME_TYPE_NULL	0x00000000UL
#define H264_FRAME_TYPE_SPS		0x00000001UL
#define H264_FRAME_TYPE_PPS		0x00000002UL
#define H264_FRAME_TYPE_IDR		0x00000003UL
#define H264_FRAME_TYPE_I		0x00000004UL
#define H264_FRAME_TYPE_P		0x00000005UL
#endif
enum frame_type
{
	H264_FRAME_TYPE_NULL,
	H264_FRAME_TYPE_SPS,
	H264_FRAME_TYPE_PPS,
	H264_FRAME_TYPE_IDR,
	H264_FRAME_TYPE_I,
	H264_FRAME_TYPE_P
};

/*
extern int get_image_width(void);
extern int get_image_height(void);
extern int get_pps_sps(char *ppsbuf, char *spsbuf);
extern int get_cur_bit_rate(void);
extern int get_cur_frame_rate(void);
extern int set_cur_frame_rate(int down_up);
extern int set_cur_bit_rate(int bitrate);
void encoder_reset(void);
extern int encoder_start(void);
extern int encoder_stop(void);
extern int open_h264_dev(void);
extern int get_bitstream_len(void);
extern int set_i_p_stride(int *value);
extern int set_gop_stride(int *value);
*/

#endif
